﻿using System;

namespace HealthCommunity.Controls
{
	public partial class UCLeftMenu : System.Web.UI.UserControl
	{
		protected void Page_PreRender(object sender, EventArgs e)
		{
			dddrgugstoremng.Visible = false;
			ddmembermng.Visible = false;

			var u = SiteContext.Current.CurrentUser;

			if (u != null && u.Role != null)
			{
				dddrgugstoremng.Visible = u.Role.RoleName.ToLower().Equals("admin");
				ddmembermng.Visible = u.Role.RoleName.ToLower().Equals("storeadmin");
				hlCreateActivity.Visible = u.Role.RoleName.ToLower().Equals("storeadmin") || u.Role.RoleName.ToLower().Equals("storemember") || u.Role.RoleName.ToLower().Equals("admin") || u.Role.RoleName.ToLower().Equals("storemanager");
				ddmydrugstore.Visible = u.Role.RoleName.ToLower().Equals("storemanager");
			}
		}
	}
}